<template>
  <div class="service-container">
    <div class="service-header">
      <h2>客服管理</h2>
      <p>管理店铺的客服对话和消息</p>
    </div>
    
    <div class="service-content">
      <div class="service-card">
        <h3>客服工作台</h3>
        <p>点击下方按钮进入客服管理后台</p>
        <el-button 
          type="primary" 
          size="large" 
          @click="openAdminChat"
          class="admin-chat-btn"
        >
          进入客服管理后台
        </el-button>
      </div>
      
      <div class="service-info">
        <h4>功能说明</h4>
        <ul>
          <li>查看在线用户列表</li>
          <li>实时聊天对话</li>
          <li>快捷回复功能</li>
          <li>对话历史记录</li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const openAdminChat = () => {
  // 打开客服管理后台
  window.open('http://localhost:8080/admin-chat', '_blank')
}
</script>

<style scoped>
.service-container {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.service-header {
  text-align: center;
  margin-bottom: 40px;
}

.service-header h2 {
  color: #333;
  margin-bottom: 10px;
}

.service-header p {
  color: #666;
  font-size: 14px;
}

.service-content {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.service-card {
  flex: 1;
  min-width: 300px;
  background: #fff;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.service-card h3 {
  color: #333;
  margin-bottom: 15px;
}

.service-card p {
  color: #666;
  margin-bottom: 25px;
}

.admin-chat-btn {
  padding: 12px 30px;
  font-size: 16px;
}

.service-info {
  flex: 1;
  min-width: 300px;
  background: #fff;
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.service-info h4 {
  color: #333;
  margin-bottom: 20px;
}

.service-info ul {
  list-style: none;
  padding: 0;
}

.service-info li {
  padding: 8px 0;
  color: #666;
  position: relative;
  padding-left: 20px;
}

.service-info li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #409eff;
  font-weight: bold;
}

@media (max-width: 768px) {
  .service-content {
    flex-direction: column;
  }
  
  .service-card,
  .service-info {
    min-width: 100%;
  }
}
</style>